package com.zmn.oms.third.guomei;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 类描述：国美清洗接口使用的常量类
 *
 * @author xiewenbing
 * @date 2019/12/02 10:30
 */

@Component
public class GmqxConsts {

    /**
     * 国美清洗渠道名称
     */
    public static final String CHANNEL_NAME = "国美美云保清洗";

    /**
     * 验证服务区域方法名称
     */
    public static final String METHOD_VERTIFY_AREA = "GJ2001";

    /**
     * 创建订单接口方法名称
     */
    public static final String METHOD_CREATE_ORDER = "GJ2002";

    /**
     * 订单取消验证方法名称
     */
    public static final String METHOD_VERTIFY_CANCEL_ORDER = "GJ2003";

    /**
     * 取消订单接口方法名称
     */
    public static final String METHOD_CANCEL_ORDER = "GJ2004";

    /**
     * 修改订单接口方法名称
     */
    public static final String METHOD_UPDATE_ORDER = "GJ2005";

    /**
     * 订单状态同步接口方法名称
     */
    public static final String METHOD_SYNC_ORDER_STATUS = "GJHZ2001";

    /**
     * 取消订单同步接口方法名称
     */
    public static final String METHOD_SYNC_CANCEL_ORDER = "GJHZ2002";

    /**
     * 订单完成同步接口方法名称
     */
    public static final String METHOD_SYNC_ORDER_FINISH = "GJHZ2003";

    /**
     * 订单创建同步接口方法名称
     */
    public static final String METHOD_SYNC_ORDER_CREATE = "GJHZ2004";

    /**
     * 修改订单预约时间同步接口方法名称
     */
    public static final String METHOD_SYNC_DUTY_TIME = "GJHZ2006";

    /**
     * 订单状态码-派单
     */
    public static final int ORDER_STATUS_CODE_DISTRIBUTE = 1300;

    /**
     * 订单状态码-工程师上门
     */
    public static final int ORDER_STATUS_CODE_VISIT = 1310;

    /**
     * 对接返回消息代码-成功
     */
    public static final int RESPONSE_CODE_SUCCESS = 200;

    /**
     * 对接返回消息代码-服务器错误
     */
    public static final int RESPONSE_CODE_SEVER_ERROR = 500;

    /**
     * 对接返回消息代码-数据验证失败
     */
    public static final int RESPONSE_CODE_DATA_VERITFY_FAILED = 501;

    /**
     * 对接返回消息代码-商品不存
     */
    public static final int RESPONSE_CODE_CREATE_ORDER_PRODUCT_NO_EXIST = 502;

    /**
     * 对接返回消息代码-不支持的服务区域
     */
    public static final int RESPONSE_CODE_VERTIFY_AREA_UNSUPPORT = 502;

    /**
     * 对接返回消息代码-商品不存在
     */
    public static final int RESPONSE_CODE_VERTIFY_ORDER_PRODUCT_NO_EXIST = 503;

    /**
     * 商品类型 - 清洗
     */
    public static final int SUPPORT_PRODUCT_TYPE_WASH = 2;

    /**
     * 商品类型 - 预约
     */
    public static final int ORDER_TYPE_APPOINTMENT = 0;

    /**
     * 商品类型 - 预付
     */
    public static final int ORDER_TYPE_PREPAY = 1;

    /**
     * 商品类型 - 预付
     */
    public static final int ORDER_TYPE_DEPOSIT = 2;

    /**
     * 办公室消毒业务代码
     */
    public static final int ORDER_PRODUCT_OFFICE_DISINFECT_ID = 11251;

    /**
     * 对接的path
     */
    public static final String REQUEST_PATH = "method=%s&msgId=%s&sign=%s";

    /**
     * 国美清洗APP ID
     */
    public static String APP_ID = "01174974CE89AB59";

    /**
     * 国美清洗APP Token
     */
    public static String API_TOKEN = "D1B9E0D501174974CE89AB59FB1C076E";

    /**
     * 国美清洗APP Aes Key
     */
    public static String AES_KEY = "9905e7ff4deb47da7eaed6a1ab7b0b53";

    /**
     * 国美清洗接入总开关
     */
    public static boolean POWER_ON;

    /**
     * 国美清洗接入Url
     */
    public static String API_URL;

    @Value("${gmqx.service.power-on:false}")
    public void setPowerOn(boolean powerOn) {
        POWER_ON = powerOn;
    }

    @Value("${gmqx.service.appid:null}")
    public void setAppId(String appId) {
        APP_ID = appId;
    }

    @Value("${gmqx.service.token:null}")
    public void setToken(String token) {
        API_TOKEN = token;
    }

    @Value("${gmqx.service.aes_key:null}")
    public void setAesKey(String aesKey) {
        AES_KEY = aesKey;
    }

    @Value("${gmqx.service.url:null}")
    public void setApiUrl(String apiUrl) {
        API_URL = apiUrl;
    }

}
